package com.jcl.recruit.searchresume.logic;

import com.jcl.core.utils.CollectionUtils;
import com.jcl.recruit.searchresume.mapper.SearchResumeWorkMapper;
import com.jcl.recruit.searchresume.model.SearchResumeWork;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @ClassName SearchResumeWorkLogic
 * @Description TODO
 * @Author yyliu
 * @Date 2018/10/26 9:25
 * @Version 1.0
 **/
@Component
public class SearchResumeWorkLogic implements SearchResumeWorkMapper{

    @Autowired
    private SearchResumeWorkMapper searchResumeWorkMapper;

    @Override
    public List<Map<String, Object>> selectResumeWorkByResumeId(Integer id) {
        return searchResumeWorkMapper.selectResumeWorkByResumeId(id);
    }

    @Override
    public List<SearchResumeWork> selectSearchResumeWorkList(Integer id) {
        return searchResumeWorkMapper.selectSearchResumeWorkList(id);
    }

    @Override
    public int batchInsertWork(List<SearchResumeWork> list) {
        return searchResumeWorkMapper.batchInsertWork(list);
    }

    @Override
    public int batchDeleteByResumeIds(List<Integer> ids) {
        if(CollectionUtils.isNotEmpty(ids)){
            return searchResumeWorkMapper.batchDeleteByResumeIds(ids);
        }
        return 0;
    }
}
